#ifndef ARGS_H
#define ARGS_H

#include "gen.h"

#define MAX_ARGS 10

struct context_link {
	GEN* source;
};

struct func_context {
	context_link links[MAX_ARGS];
	int linksnum;
};

void init_context(func_context* context);

GEN get_GEN_arg(PyObject* args, int* args_used, bool has_def, GEN def, 
            bool* error);
long get_long_arg(PyObject* args, int* args_used, bool has_def, long def, 
            bool* error);
const char* get_char_arg(PyObject* args, int* args_used, bool has_def, const char* def, 
            bool* error);
GEN get_string_arg(PyObject* args, int* args_used, bool has_def, const char* def, 
            bool* error);
entree* get_ref_var_arg(func_context* context, PyObject* args, int* args_used, 
            bool* error);
char* get_eval_arg(func_context* context, PyObject* args, int* args_used, 
            bool long_expression, bool* error);
long get_var_arg(PyObject* args, int* args_used, bool has_def, long def, 
            bool* error);
entree* get_var_entree_arg(PyObject* args, int* args_used, 
            bool* error);
PyObject* get_ref_arg(PyObject* args, int* args_used, bool has_def, PyObject* def, 
            bool* error);
void copy_reference(PyObject* ref, GEN val);
void test_remaining_arg(PyObject* args, int* args_used, bool* error);
long get_real_precision();
long get_series_precision();

GEN callback_func(char* expr);
#endif
